package com.atguigu.springcloud.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @Author: 19shusheng.com
 * @Description:
 * @Date: Created in 21:22 2020/10/27
 * @Modified By:
 */
@RestController
@RequestMapping("/consumer/order")
@Slf4j
public class OrderzkController {
    @Resource
    private RestTemplate restTemplate;

    public static final String INVOKE_URL1 = "http://localhost:8004";

    public static final String INVOKE_URL2 = "http://cloud-provider-payment:8004";

    @GetMapping("/getPaymentInfo")
    @ResponseBody
    public String paymentInfo(){
        String forObject = restTemplate.getForObject(INVOKE_URL1 + "/payment/zk", String.class);
        return forObject;
    }
}
